package com.pan.common.base;

import com.pan.common.standard.PersistStatus;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @author by panstark
 * @description
 * @notice
 * @date 2020/11/27
 */
@Getter
@Setter
@NoArgsConstructor
@MappedSuperclass
public class BaseEntity {

    @Id
    @Column(name = "ID")
    private String id;

    @Column(name = "CREATOR")
    private String creator;

    @Column(name = "CREATION_TIME")
    private Date creationTime;

    @Column(name = "MODIFIER")
    private String modifier;

    @Column(name = "MODIFIED_TIME")
    private Date modifiedTime;

    @Column(name = "TS")
    protected Date ts;

    @Column(name = "DR")
    protected Integer dr = 0;

    @Transient
    protected String persistStatus = PersistStatus.UNCHANGED;
}
